package demo2;

import java.util.ArrayList;

public class Demo4 {

    //Dump文件：-Xms1m -Xmx8m -XX:+HeapDumpOnOutOfMemoryError

    byte[] arr = new byte[1024*1024];

    public static void main(String[] args) {
        ArrayList<Demo4> list = new ArrayList<>();
        int count = 0 ;
        try {
            while (true){
                list.add(new Demo4());
                count ++ ;
            }
        }catch (Exception e){
            System.out.println(count);
        }

    }
}
